Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Update packagist service to use TLS#1049

Merged
kdaigle merged 3 commits into
github:masterfrom
Seldaek:patch-1
May 12, 2015
Merged

Update packagist service to use TLS#1049
kdaigle merged 3 commits into
github:masterfrom
Seldaek:patch-1

Conversation

@Seldaek

@Seldaek Seldaek commented May 4, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@stof

stof commented May 4, 2015

Copy link
Copy Markdown
Contributor

@Seldaek you need to update the tests too

@Seldaek

Seldaek commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

Oh I missed the failed build thanks

@stof

stof commented May 4, 2015

Copy link
Copy Markdown
Contributor

I suggest adding a test ensuring that packagist.org is forced as https

@Seldaek

Seldaek commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

Done

@kdaigle

kdaigle commented May 6, 2015

Copy link
Copy Markdown
Member

This still feels somewhat error prone because of the regexes. I with we could specify to http_post that we want to force TLS.

Either way, you do have an ssl[:verify] = false which really negates most of the benefits of pushing everything to TLS. Can you fix that for this PR before I submit this more review?

@Seldaek

Seldaek commented May 6, 2015

Copy link
Copy Markdown
Contributor Author

@kdaigle yeah I am not sure why that is there tbh.. I removed that line, but I don't think we should necessarily force TLS always because if people use that hook with custom installs they might not have an https endpoint, so I only force it for packagist. And yes it's a bit messy with the regex but I don't see any other way to force all existing configs that might have http://packagist.org hardcoded in them to do the upgrade.

Comment thread lib/services/packagist.rb Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use \z to denote the end of the string instead of $?

Can you also use \A to denote the beginning of the string instead of the ^ here?

Thank you!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind doing it, but I am curious why? :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done BTW

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Seldaek with the ^ and $, it'd be possible to add a newline into the string and still get a correct match since those match per "line" and not "per string".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's only true with the m modifier though? Unless ruby has that on by default, I don't know it much :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The /m flag only changes the meaning of . to match newline characters. Otherwise, this is a good way to make sure we don't over match.

@kdaigle

kdaigle commented May 7, 2015

Copy link
Copy Markdown
Member

cc @gregose @mastahyeti @ptoomey3 @oreoshake for a review of this PR before merging

@ptoomey3

ptoomey3 commented May 7, 2015

Copy link
Copy Markdown
Member

👍 - Thanks for setting 🔥 to http.ssl[:verify] = false (though I'm a bit sad to see how prevalent this is throughout github-services 😢 ).

@Seldaek

Seldaek commented May 7, 2015

Copy link
Copy Markdown
Contributor Author

@ptoomey3 I am pretty sure it was added originally because the hook started off as a copy paste of another hook.. Lots of non-ruby devs contributing to this and doing things by following (sometimes bad) examples.

kdaigle added a commit that referenced this pull request May 12, 2015
Update packagist service to use TLS
@kdaigle
kdaigle merged commit 39b286d into github:master May 12, 2015
@kdaigle

kdaigle commented May 12, 2015

Copy link
Copy Markdown
Member

Thanks! We'll get this deployed in the next few days. 🍰

@quazardous

Copy link
Copy Markdown

A push on the "Test Service" may help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants